package com.audaque.springboot.foshanupload.web.rocketmqdemo.listener;

import com.audaque.springboot.foshanupload.web.rocketmqdemo.model.User;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQReplyListener;
import org.springframework.stereotype.Service;

@Service
@RocketMQMessageListener(topic = "sendAndReceive-user-user", consumerGroup = "sendAndReceive-user-user-push")
public class SendAndReceiveUserListener implements RocketMQReplyListener<User, User> {
    public User onMessage(User user) {
        System.out.printf("------- ObjectConsumerWithReplyUser received: %s \n", user);
        User replyUser = new User("replyUserName",(byte) 10);
        return replyUser;
    }
}